//
//  SC_Search_SectionHeaderView.swift
//  APSwift
//
//  Created by jianbo.pei on 2023/4/26.
//

import Foundation
import UIKit

class SC_Search_SectionHeaderView: APBaseTableHeaderFooterView {
    private var titleLabel: UILabel!
    
    override func initUI() {
        super.initUI()
        backgroundColor = .white
        titleLabel = UILabel().then({ make in
            addSubview(make)
            make.font(.ap.medium(16))
            make.textColor(.ap.hex("2D2A2B"))
        })
    }
    
    override func makeConstraints() {
        super.makeConstraints()
        titleLabel.snp.makeConstraints { make in
            make.left.equalTo(16)
            make.centerY.equalToSuperview()
        }
    }
    
    override func setup(_ model: Any?) {
        guard let model = model as? SC_Search_Header_M else { return }
        titleLabel.text = model.title
    }
    
}

extension SC_Search_SectionHeaderView: APHeader_Height_Protocol {
    static func headerViewHeight(with model: Any?) -> CGFloat {
        40
    }
}

